/* products.less */
page {
  background-color: #f5f5f5;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  justify-content: start;
}

/* 搜索栏 */
.search-bar {
  position: relative;
  margin: 20rpx;
  background: white;
  border-radius: 40rpx;
  padding: 0 30rpx;
  box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
  width: 95%;
}

.search-input {
  height: 80rpx;
  font-size: 28rpx;
  padding-right: 60rpx;
}

.search-icon {
  position: absolute;
  right: 30rpx;
  top: 50%;
  transform: translateY(-50%);
  width: 32rpx;
  height: 32rpx;
}

/* 分类标签 */
.category-tabs {
  white-space: nowrap;
  padding: 20rpx 0;
  background: white;
  margin-bottom: 20rpx;
}

.tab-item {
  display: inline-block;
  padding: 20rpx 40rpx;
  margin: 0 10rpx;
  font-size: 28rpx;
  color: #666;
  border-radius: 30rpx;
  background: #f5f5f5;
}

.tab-item.active {
  color: #fff;
  background: #ff6b9d;
}

/* 产品网格 */
.product-grid {
  flex: 1;
  padding: 0 20rpx;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: flex-start;
}

.product-card {
  background: white;
  border-radius: 20rpx;
  overflow: hidden;
  box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
  width: 100%;
  margin-bottom: 20rpx;
}

.product-content {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  padding: 0;
}

.product-image {
  width: 40%;
  height: 326rpx;
  border-radius: 20rpx 20rpx 0 0;
  margin-right: 0;
  flex-shrink: 0;
  margin: 10rpx;
}

.product-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20rpx;
}

.product-name {
  font-size: 30rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 12rpx;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-desc {
  font-size: 26rpx;
  color: #666;
  margin-bottom: 16rpx;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-detail {
  font-size: 24rpx;
  color: #888;
  margin-bottom: 16rpx;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16rpx;
}

.current-price {
  font-size: 36rpx;
  font-weight: bold;
  color: #ff4757;
  margin-right: 16rpx;
}

.original-price {
  font-size: 26rpx;
  color: #999;
  text-decoration: line-through;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 16rpx;
  flex-wrap: wrap;
}

.sales-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8rpx;
}

.sales-text {
  font-size: 24rpx;
  color: #999;
}

.rating {
  display: flex;
  align-items: center;
}

.star-icon {
    width: 24rpx;
    height: 24rpx;
    margin-right: 4rpx;
  }

.rating-text {
  font-size: 24rpx;
  color: #ffa500;
}

.buy-btn {
  padding: 20rpx 40rpx;
  background: linear-gradient(135deg, #ff4757, #ff6b7a);
  color: #fff;
  border: none;
  border-radius: 12rpx;
  font-size: 30rpx;
  font-weight: bold;
  flex-shrink: 0;
  margin-left: auto;
  box-shadow: 0 4rpx 12rpx rgba(255, 71, 87, 0.3);
}

.cart-icon {
    width: 32rpx;
    height: 32rpx;
  }

/* 购买弹窗 */
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.buy-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  border-radius: 40rpx 40rpx 0 0;
  padding: 40rpx;
  z-index: 1001;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40rpx;
}

.modal-title {
  font-size: 36rpx;
  font-weight: bold;
  color: #333;
}

.close-icon {
  width: 48rpx;
  height: 48rpx;
}

.modal-product-image {
  width: 120rpx;
  height: 120rpx;
  border-radius: 12rpx;
  margin-right: 20rpx;
}

.product-info {
  display: flex;
  align-items: center;
}

.product-details {
  flex: 1;
}

.product-details .product-name {
  font-size: 32rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 10rpx;
}

.product-details .product-price {
  font-size: 36rpx;
  font-weight: bold;
  color: #ff6b9d;
}

.quantity-section {
  margin-bottom: 40rpx;
}

.section-title {
  font-size: 32rpx;
  font-weight: bold;
  color: #333;
  margin-bottom: 20rpx;
  display: block;
}

.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2rpx solid #eee;
  border-radius: 8rpx;
  width: 200rpx;
  height: 80rpx;
}

.quantity-btn {
  width: 60rpx;
  height: 60rpx;
  background: #f5f5f5;
  border: none;
  border-radius: 8rpx;
  font-size: 36rpx;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-text {
  flex: 1;
  text-align: center;
  font-size: 32rpx;
  font-weight: bold;
  color: #333;
}

.total-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40rpx;
  padding: 20rpx 0;
  border-top: 2rpx solid #f5f5f5;
}

.total-label {
  font-size: 32rpx;
  color: #333;
}

.total-price {
  font-size: 40rpx;
  font-weight: bold;
  color: #ff6b9d;
}

.submit-btn {
  width: 100%;
  height: 88rpx;
  background: #ff6b9d;
  color: white;
  border: none;
  border-radius: 44rpx;
  font-size: 32rpx;
  font-weight: bold;
}

/* 加载状态 */
.loading-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100rpx 0;
}

.loading-text {
  font-size: 32rpx;
  color: #999;
}

/* 空状态 */
.empty-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100rpx 0;
}

.empty-image {
  width: 200rpx;
  height: 200rpx;
  margin-bottom: 30rpx;
  opacity: 0.5;
}

.empty-text {
  font-size: 32rpx;
  color: #999;
}